package com.li.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.li.entity.PageResult;
import com.li.entity.QueryPageBean;
import com.li.entity.Result;
import com.li.service.LogService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
public class LogController {

    @Reference
    private LogService logService;

    @RequestMapping("/findLog")
    public PageResult findLog(@RequestBody QueryPageBean queryPageBean) throws Exception {
        return logService.selectPageByCondition(queryPageBean);
    }

    @RequestMapping("/delete")
    public Result delete(Integer id) throws Exception {
        logService.deleteById(id);
        return new Result(true, "删除日志成功");
    }
}
